<template>
	<view style="width: 100%;display: flex;flex-direction: column;background: #fafafa;">
		<view style="width: 100%;display: flex;align-items: flex-start;padding: 25rpx;background: #fafafa;">
			<u-avatar :src="$store.state.common.systemInfo.fileurl + info.avatar" mode="square"></u-avatar>
			<view style="flex: 1;display: flex;flex-direction: column;margin-left: 10rpx;">
				<view style="font-size: 30rpx;font-weight: bold;">
					{{info.name}}
				</view>
				<view style="font-size: 24rpx;color: #a8a8a8;margin-top: 6rpx;">
					{{info.phone}}
				</view>
			</view>
		</view>

		<view style="margin-top: 40rpx;margin-bottom: 10rpx;">
			<u-gap height="1" bg-color="#ececec"></u-gap>
		</view>
		
		<view style="width: 100%;display: flex;flex-direction: row;justify-content: space-between;align-items: center;padding: 15rpx;background: #fafafa;">
			<view style="font-size: 30rpx;">
				个性签名
			</view>
			<view style="font-size: 26rpx;color: #545454;">
				{{info.note}}
			</view>
		</view>
		
		<view style="margin-top: 15rpx;margin-bottom: 15rpx;">
			<u-gap height="1" bg-color="#ececec"></u-gap>
		</view>
		
		<view style="width: 100%;display: flex;flex-direction: row;justify-content: space-between;align-items: center;padding: 15rpx;background: #fafafa;">
			<view style="font-size: 30rpx;">
				推荐给好友
			</view>
			<view style="font-size: 26rpx;color: #545454;">
				<u-icon name="arrow-right"></u-icon>
			</view>
		</view>
		
		<view style="margin-top: 15rpx;">
			<u-gap height="20" bg-color="#ececec"></u-gap>
		</view>
		
		<view @click="goaddsendapply" style="width: 100%;padding: 30rpx;background: #fafafa;display: flex;align-items: center;justify-content: center;font-weight: bold;color: #2f5f8f;">
			添加好友
		</view>

	</view>
</template>

<script>
	export default {
		data(){
			return {
				info:{}
			}
		},
		onLoad({id}) {
			this.getdata(id)
		},
		methods:{
			getdata:async function(id){
				const ret = await this.$u.get(`common/common/getdata/user/${id}`)
				this.info = ret.data
			},
			goaddsendapply:function(){
				uni.navigateTo({
					url:"/pages/friend/sendapply?id="+this.info.id + "&name="+this.info.name
				})
			},
		}
	}
</script>

<style>
	page {
		background: #ececec;
	}
</style>